#pragma once


struct _Snake
{
	int nX;
	int nY;
	struct _Snake* pNextNode;
};

extern struct _Snake *g_pSnakeH;
extern struct _Snake *g_pSnakeT;
extern struct _Snake *g_pSnakeT1;
extern int g_nHeadX;
extern int g_nHeadY;
extern int g_nTailX;
extern int g_nTailY;
extern int g_nHeadDir; 
extern int state; //state=1 continue, state=0 exit.

void TailMove();
int HeadMove();
void gotoxy(int nX, int nY);
void MapImage();
int GameOverImage();
struct _Snake* CreateSnake(int nX, int nY);
struct _Snake* AddSnake(struct _Snake* Snake,struct _Snake* g_pSnakeH);